package com.rx.mgt.dao;

import com.rx.mgt.dao.base.ManagementHibernateDaoBase;
import com.rx.mgt.domain.WhiteListDomain;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

/**
 * Created by zxj on 2017/8/15.
 */
@Repository
public class EmailWhiteListDao extends ManagementHibernateDaoBase<WhiteListDomain,Long> {
    public WhiteListDomain findByAddress(String address) {
        String hql = "from WhiteListDomain a where a.address =:address";
        Query query = template.getSessionFactory().getCurrentSession().createQuery(hql);
        query.setParameter("address",address);
        return (WhiteListDomain)query.uniqueResult();
    }
}
